
import schedule from 'node-schedule'
import request from 'request'

const config = {
  cookie: 'csrf_session_id=670d0aceec4a15a8109d219595116348',
  url: 'https://juejin.cn/',
  check_url: 'https://api.juejin.cn/growth_api/v1/check_in?aid=2608&uuid=7472929133467682340&spider=0&msToken=YmsZgZsoM_yk0UgmHRvHjAFm3YVzUyt8PiKqE6zweDrFpQtL1HBY7bmUm2ly0KqWZNPGCCcBHqyY2AcP1pbaF_be1r13vusVJlRGwBS1YemIKZBr6YqjqfCzNdFFoix2&a_bogus=OjBEvO2gMsm1A7fFRwDz9JSEMuL0YW-RgZEP7wFWP0oD'
}
schedule.scheduleJob('*/5 * * * * *', () => {
  request(config.check_url, {
    method: 'post',
    headers: {
      Referer: config.url,
      Cookie: config.cookie
    },
  }, function (error, response, body) {
    console.log(response)
  })
})
